<?php
/**
 * Dragons Fun copy
 * @author aanbek
 */
$title = 'Драконы';
include_once 'inc/fnc.php';
if (!isset($user)) {
    header("Location:/");
    exit;
}
$id = isset($_GET['id']) ? (int)abs($_GET['id']) : $user['id'];
if (isset($id)) {
    $dataRows = $db->rows("SELECT `id` FROM `users` WHERE `id`=?",
        array($id));
    if ($dataRows == 0) {
        $data =& $user;
    } else {
        $data = $db->fetch("SELECT * FROM `users` WHERE `id`=?",
            array($id));
    }
}
$expProgres = round(100 / ($expLevel[$data['level']] / ($data['exp'] + 1))) + 1;
    if ($expProgres > 100) {
        $expProgres = 100;
    }
?>
<div class="m10">

<div class="profile_avatar">
<a href="./profile/avatars">
<div class="profile_avatar_b"></div>
<img src="/images/dragons/d_fire_1_120.jpg" width="50" height="50" alt="">

</a>
</div>
<div class="major">
<div class="str"><span><?=$data['login']?></span></div>
</div>
<span class="info"><span><?=$data['level']?></span> уровень</span><br>

Опыт: <span class="info"><?=$data['exp']?></span> <span class="minor">(<span><?=$expProgres;?></span>%)</span><br>



<? if($data['id'] == $user['id']){?>
<div class="clr"></div>
<div class="hr mtb5"></div>
<div class="menu">
<div class="menu_btn">
<a href="./mail">
<span class="menu_btn_l"><img src="/images/m_letter.png" width="44" height="30" alt=""></span>
<span>Почта</span>
</a>
</div>
</div>
<div class="menu">
<div class="menu_btn">
<a href="./friends">
<span class="menu_btn_l"><img src="/images/m_friends.png" width="44" height="30" alt=""></span>
<span>Друзья</span>
</a>
</div>
</div>
<div class="hr mtb5"></div>
<div class="menu">
<div class="menu_btn">
<a href="./achievements">
<span class="menu_btn_l"><img src="/images/m_ach.png" width="44" height="30" alt=""></span>
<span>Достижения</span>
</a>
</div>
</div>
<div class="hr mtb5"></div>
<div class="menu">
<div class="menu_btn">
<a href="./cfg">
<span class="menu_btn_l"><img src="/images/m_options.png" width="44" height="30" alt=""></span>
<span>Настройки</span>
</a>
</div>
</div>
<div class="plate_nor mtb10 mlr10">
<div class="plate_nor_b">
<div class="plate_nor_l">
<div class="plate_nor_r">
<div class="plate_nor_rt">
<div class="plate_nor_rb">
<div class="plate_nor_lt">
<div class="plate_nor_lb normal">
<div class="h1 major mt10"><span>Ресурсы</span></div>
Еда: <span class="nwr"><img src="/images/food_16.png" width="16" height="16" alt=""><span class="info"><?=$user['food']?></span></span><br>
Золото: <span class="nwr"><img src="/images/coin_16.png" width="16" height="16" alt=""><span class="info"><?=$user['coin']?></span></span><br>
Кристаллы: <span class="nwr"><img src="/images/crys_16.png" width="16" height="16" alt=""><span class="info"><?=$user['crys']?></span></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?}?>
</div>
<?
include_once 'inc/foot.php';

